﻿@model List<Subscription>
@{
    Layout = "_Layout.cshtml";
}
<div class="widget">
    <div class="header">
        <span class="icon"></span>
        @ViewBag.ActiveUrl.Title
    </div>
    <form action="@ViewBag.ActiveUrl.Url" class="ajax">
    <table>
        <tr>
            <td class="table-header width10">
                <input type="checkbox" onclick="$.MvcForum.toggleCheckbox(this.checked)" />
            </td>
            <td class="table-header width65">
                @ForumContext.GetText(LanguageSection.TOPICS, (SubscriptionType)ViewBag.SubscriptionType == SubscriptionType.Forum ? "Forum" : "Topic")
            </td>
            <td class="table-header">
                @ForumContext.GetText(LanguageSection.SUBSCRIPTION, "NOTIFICATION_TYPE")
            </td>
        </tr>
        @if (Model.Count > 0)
        {
            foreach (Subscription s in Model)
            {

            <tr>
                <td class="table-cell center">
                    <input type="checkbox" value="@s.Id" runat="server" class="selected"  id="Id" name="Id" />
                </td>
                <td class="table-cell">
                    @(s.TopicId.HasValue ? Html.Link(ForumContext.ThreadLink(s.TopicId.Value, s.TopicName, null), s.TopicName) : Html.Link(ForumContext.ForumLink(s.ForumId.Value, s.ForumName, null), s.ForumName))
                </td>
                <td class="table-cell center">
                    @ForumContext.GetText(LanguageSection.SUBSCRIPTION, ((NotificationType)s.NotificationType).ToString())
                </td>
            </tr>
            }
                        
            <tr>
                <td class="table-cell" colspan="3">
                    @Html.DropDownList("notify", (List<SelectListItem>)ViewBag.NotifyType, new { @class = "select" })
                    @Html.Button(ButtonType.Submit, ForumContext.GetText(LanguageSection.GLOBAL, "Update"), new { @class = "ui-button" })
                </td>
            </tr>
        }
    </table>
    </form>
</div>
